#!/bin/sh

usageAndDie() {
  echo "usage: `basename $0`"
  echo ""
  echo "example: ./build.sh"
  echo ""
  echo "Build executable package."
  echo ""
  exit 1
} # usageAndDie

PY_I18N_HOME=/host/ProductDev/python_i18n
BUILDDIR=buildjavavatask

echo "Copy i18n files to current source folder..."
cp -rf $PY_I18N_HOME/i18n_util.py \
    $PY_I18N_HOME/msgfmt.py \
    $PY_I18N_HOME/po2mo.py \
    $PY_I18N_HOME/py2po.py \
    $PY_I18N_HOME/pygettext.py ./

# echo "Create make spec..."
# python $PYINSTALLER_HOME/Makespec.py --upx --name=javavatask main.py

# echo "Build executable by the spec..."
# python $PYINSTALLER_HOME/Build.py javavatask.spec

echo "Create tar.gz for this application..."
tar czvf javavatask.tar.gz ./

echo "Remove i18n files from current source folder..."
rm -rf ./i18n_util.py \
    ./msgfmt.py \
    ./po2mo.py \
    ./py2po.py \
    ./pygettext.py \
    $BUILDDIR

echo "Build succussfully..."

